#ifndef __ui_handler_h__
#define __ui_handler_h__

#include "windefine.h"
#include "winresource.h"
#include "../xml/xml.h"
#include "../core/core.h"
#include "../base/common.h"
#include "../tool/scoped_ptr.h"
#include "../core/define.h"

#include <string>

class UIHandler
{
public:
    UIHandler();
    ~UIHandler();

    void SetPath( const wchar_t *file );

    BOOL Parse();

    core::FaceWindow* Generate( const char *xml );

    core::FaceWindow* Body();

    core::FaceWindow* Active();
    void SetActive( core::FaceWindow* control );

    void SetWindowDelegate( core::HandleDelegate* delegate );

    core::FaceStyleManager* StyleManager();

    core::FaceWindow* FindControl( const std::string &id );

private:
    BOOL ParseContext( XmlElement* pElement );

private:
    std::wstring            file_;
    core::FaceWindow        *body_;
    core::FaceWindow        *active_;
    core::FaceStyleManager  style_manager_;
};

#endif